<!--
 * @Author: byron
 * @Date: 2021-09-01 20:31:07
 * @LastEditTime: 2021-09-01 20:34:22
-->
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script type="text/javascript">
        // 对象即是键值对
        // 获取对象的属性可以 obj.属性名 也可obj['属性名']
        let a = 'sex'
        let obj = {}
        obj.name = 'tom'
        obj[a] = '男'
        console.log(obj);
    </script>
</body>

</html>